#coding=utf-8

wordstring = """
    it was the best of times of times it was the worst of times.
    it was the age of age of wisdom it was the age of foolishness.
    """

wordstring = wordstring.replace('.','')

wordlist = wordstring.split()

wordfreg = []
for w in wordlist:
    wordfreg.append(wordlist.count(w))

d = dict(zip(wordlist,wordfreg))
print(d)